//
//  IGMoreWorksSelectVC.m
//  jingdongfang
//
//  Created by MTiMac02 on 2018/5/14.
//  Copyright © 2018年 BOE-SBG-CTO. All rights reserved.
//

#import "IGMoreWorksSelectVC.h"
#import "FindLayout.h"
#import "IGMydeletApi.h"
#import "IGiGalleryListApi.h"
#import "MoreArteditCell.h"
#import "IGPushiGalleryListVC.h"
#import "IGiGalleryPushApi.h"
#import "IGPictureDetailApi.h"
#import "IGAddToDrawVC.h"
#import "IGDelProductInDrawApi.h"

@interface IGMoreWorksSelectVC ()<UICollectionViewDataSource, UICollectionViewDelegateFlowLayout,UICollectionViewDelegate>
{
    UICollectionView *collect;
    NSMutableArray *selArr;
    UIView *bottomBar;
    
    NSString *p_idsStr;
    NSString *pay_type;
    NSMutableArray *imageUrlArr;
    NSString *createId;//画单创建者id
    UILabel * titleLabel;
    NSMutableArray *selIndexArr;
    
    
    UIButton *leftBtn;
    UIButton *rightBtn;
    NSInteger selCount;
    NSString *pushSuccess;
}
@property (nonatomic, strong) IGiGalleryListApi *igalleryListApi;
@property (nonatomic, strong) IGPictureDetailApi *pictureDetailApi;
@property (nonatomic, strong) IGDelProductInDrawApi *delApi;
@property (nonatomic, strong) NSArray *iGalleryListArr;
@property (nonatomic, strong)NSMutableArray *dataArr;
@property (nonatomic, copy) NSString *pageNumber;
@property (nonatomic, copy) NSString *pageSize;
@property (nonatomic, copy) NSString *queryTime;


@end
@implementation IGMoreWorksSelectVC
#pragma mark-懒加载
-(NSMutableArray *)dataArr{
    if (!_dataArr) {
        _dataArr=[NSMutableArray array];
    }
    return _dataArr;
}
-(NSArray *)iGalleryListArr{
    if (!_iGalleryListArr) {
        _iGalleryListArr=[NSArray array];
    }
    return _iGalleryListArr;
}
#pragma mark--设置生命周期
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor mainBackgroundColor];
    titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 20)] ;
    titleLabel.textColor=[UIColor c1Color];
    titleLabel.font=[UIFont font18];
    titleLabel.text = [NSString stringWithFormat:@"已选 %ld 张",selIndexArr.count];
    self.navigationItem.titleView = titleLabel ;
    [self setBarBtn];
    [self setCollectionview];
    [self setBottomBar];
    [self requestIGlist];
    if (self.type==dayRecType) {
        _dataArr=[NSMutableArray arrayWithArray:self.recDataArr];
        for (int i=0; i<self.recDataArr.count; i++) {
            [selArr addObject:@(NO)];
        }
    }
    if (self.type==artDrawType) {
        self.pictureDetailApi = [IGPictureDetailApi new];
        [self requestDate];
    }
    
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];
    if ([pushSuccess isEqualToString:@"1"]) {
        pushSuccess=@"0";
    }
}
- (instancetype)initWithType:(IGMoreArtOperationType)type
{
    if (self = [super init])
    {
        self.type = type;
    }
    return self;
}
#pragma mark--设置导航栏按钮
-(void)setBarBtn{
    //导航栏左侧按钮
    leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    leftBtn.frame = CGRectMake(0, 0, 60, 36);
    [leftBtn.titleLabel setFont:[UIFont font16]];
    [leftBtn setTitle:NSLocalizedString(@"Select All", nil) forState:UIControlStateSelected];
    [leftBtn setTitle:NSLocalizedString(@"Select All", nil) forState:UIControlStateNormal];
    [leftBtn setImage:[UIImage imageNamed:@"gnoselect"] forState:UIControlStateNormal];
     [leftBtn setImage:[UIImage imageNamed:@"guoselect"] forState:UIControlStateSelected];
    leftBtn.titleEdgeInsets=UIEdgeInsetsMake(0, 8, 0, 0);
    leftBtn.contentEdgeInsets=UIEdgeInsetsMake(0, -10, 0, 0);
    [leftBtn setTitleColor:[UIColor c4Color]forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(select:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
    [leftBtn setSelected:NO];
    //导航栏右侧按钮
    rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    rightBtn.frame = CGRectMake(0, 0, 50, 36);
    rightBtn.titleEdgeInsets=UIEdgeInsetsMake(0, 0, 0, -10);
    [rightBtn.titleLabel setFont:[UIFont font16]];
    [rightBtn setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
    [rightBtn setTitleColor:[UIColor c4Color]forState:UIControlStateNormal];
    [rightBtn addTarget:self action:@selector(cancle) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
}
#pragma mark--初始化UICollectionView
-(void)setCollectionview{
    FindLayout *layout = [[FindLayout alloc] init];
    collect = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 64, KSCREENWIDTH, KSCREENHEIGHT-60-NavigationMagin) collectionViewLayout:layout];
    collect.backgroundColor = [UIColor clearColor];
    collect.delegate = self;
    collect.dataSource = self;
    if (@available(iOS 11.0, *)) {
        collect.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        collect.contentInset = UIEdgeInsetsMake(0, 0, 60, 0);
        collect.scrollIndicatorInsets = collect.contentInset;
    }
    collect.alwaysBounceVertical = YES;
    [collect registerClass:[MoreArteditCell class] forCellWithReuseIdentifier:@"MoreArteditCell"];
    [self.view addSubview:collect];
    selArr=[NSMutableArray array];
 
}
#pragma mark--底部菜单逻辑
-(void)setBottomBar{
    bottomBar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KSCREENWIDTH, 60)];
    bottomBar.backgroundColor = [UIColor c1Color];
     bottomBar.top = self.view.height-60;
    [self.view addSubview:bottomBar];
    if (createId==[IGUser getUid]) {
        [self setBottomBar2];
    }else {
        [self setBottomBar1];
    }
}
#pragma mark--请求数据
-(void)requestDate{
    self.pictureDetailApi.drawlistId=self.drawId;
    [self.pictureDetailApi startWithDecodeClass:[IGPictureDetailResp class] CompletionBlockWithSuccess:^(id responseObject, NSError *error) {
        if (responseObject) {
            IGPictureDetailResp *resp=responseObject;
            IGDrawModel *model=resp.data;
            if (model.productList&&model.productList.count>0) {
            }
            else
            {
                [collect ig_endFooterRefreshingWithNoMoreData];
            }
            createId=model.uId;
            _dataArr = [NSMutableArray arrayWithArray:model.productList];
    
            for (int i=0; i<model.productList.count; i++) {
                [selArr addObject:@(NO)];
            }
            [collect reloadData];
        }
        else
        {
            //空白页处理逻辑写在这里
        }
    }];
}

#pragma mark - UICollectionViewDataSource, UICollectionViewDelegateFlowLayout
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
        return  _dataArr.count>0?_dataArr.count:0;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    MoreArteditCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MoreArteditCell" forIndexPath:indexPath];
    cell.isSimilar=NO;
    titleLabel.text = [NSString stringWithFormat:@"已选 %ld 张",selIndexArr.count];
    cell.data=_dataArr[indexPath.item];
    cell.isSel = [selArr[indexPath.item]boolValue] ;
    [cell setNeedsLayout];
    [self resetTitle];
    return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
        selIndexArr = [NSMutableArray array];
        for (int i=0; i<selArr.count; i++) {
            selCount=selIndexArr.count ;
            [collect reloadData];
            NSNumber *s = selArr[i];
            if ([s boolValue]) {
                [selIndexArr addObject:@(i)];
            }
        }
        BOOL sel = [selArr[indexPath.item] boolValue];
        [selArr removeObjectAtIndex:indexPath.item];
        [selArr insertObject:@(!sel) atIndex:indexPath.item];

        dispatch_async(dispatch_get_main_queue(), ^{
            [collect reloadData];
        });
  
    
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
    IGArtWorkModel *base=_dataArr[indexPath.item];
    if ([base.plates integerValue]==1)
    {
        //横板
        return CGSizeMake((KSCREENWIDTH-16)/2, ((KSCREENWIDTH-16)/2*1080/1920));
    }
    else if ([base.plates integerValue]==2)
    {
        //坚板
        return CGSizeMake((KSCREENWIDTH-16)/2, ((KSCREENWIDTH-16)/2*1920/1080));
    }
    return CGSizeMake(0, 0);
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
    return UIEdgeInsetsMake(5, 5, 5, 5);
}
#pragma mark--加载标题数据
-(void)resetTitle{
    NSMutableArray *selIndexArr = [NSMutableArray array];
    for (int i=0; i<selArr.count; i++) {
        NSNumber *s = selArr[i];
        if ([s boolValue]) {
            [selIndexArr addObject:@(i)];
        }
    }
    if (selIndexArr.count==_dataArr.count) {
        [leftBtn setSelected:YES];
    }
    if (selIndexArr.count==0) {
        [leftBtn setSelected:NO];
    }
        NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"已选 %ld 张",selIndexArr.count]];
    NSRange range1=[[string string]rangeOfString:@"已选"];
    [string addAttribute:NSForegroundColorAttributeName value:[UIColor c4Color] range:range1];
    
    NSRange range2=[[string string]rangeOfString:@"张"];
    [string addAttribute:NSForegroundColorAttributeName value:[UIColor c4Color] range:range2];
    
    titleLabel.attributedText=string;
}

#pragma mark--全选
-(void)select:(UIButton *)allBtn{
    allBtn.selected=!allBtn.isSelected;
    if (allBtn.selected) {
        for (int i=0; i<_dataArr.count; i++) {
            BOOL sel = [selArr[i] boolValue];
            if (sel==1) {
                sel=!sel;
            }
            [selArr removeObjectAtIndex:i];
            [selArr insertObject:@(!sel) atIndex:i];
        }
         [collect reloadData];
    }else{
        for (int i=0; i<_dataArr.count; i++) {
               BOOL sel = [selArr[i] boolValue];
              if (sel==0) {
                    sel=!sel;
                 }
               [selArr removeObjectAtIndex:i];
               [selArr insertObject:@(!sel) atIndex:i];
              }
               [collect reloadData];
    }
}
#pragma mark-添加到画单
-(void)addViewClick{
    NSMutableArray *selIndexArr = [NSMutableArray array];
    for (int i=0; i<selArr.count; i++) {
        NSNumber *s = selArr[i];
        if ([s boolValue]) {
            [selIndexArr addObject:@(i)];
        }
    }
    if (selIndexArr.count==0) {
        [self presentMessageTips:NSLocalizedString(@"Select at least one Work", nil)];
        return;
    }
    NSMutableArray *infoArr = [NSMutableArray array];
    for (NSNumber *index in selIndexArr) {
        IGArtWorkModel *work = _dataArr[[index integerValue]];
        [infoArr addObject:work];
        NSMutableArray *aIds = [NSMutableArray array];
        for (IGArtWorkModel *info in infoArr) {
            [aIds addObject:info.aId];
        }
        IGAddToDrawVC *addVc=[[IGAddToDrawVC alloc]init];
        addVc.workIds=aIds;
        [UIViewController ig_pushViewController:addVc animated:YES];

     }
}
#pragma mark-推送
-(void)pushViewClick{
    NSMutableArray *selIndexArr = [NSMutableArray array];
    for (int i=0; i<selArr.count; i++) {
        NSNumber *s = selArr[i];
        if ([s boolValue]) {
            [selIndexArr addObject:@(i)];
        }
    }
    if (selIndexArr.count==0) {
        [self presentMessageTips:NSLocalizedString(@"Select at least one Work", nil)];
        return;
    }
    NSMutableArray *infoArr = [NSMutableArray array];
    for (NSNumber *index in selIndexArr) {
        IGArtWorkModel *work = _dataArr[[index integerValue]];
        [infoArr addObject:work];
    }
    if (self.iGalleryListArr.count == 0) {
        [self presentMessageTips:NSLocalizedString(@"No linked device found", nil)];
    } else if (self.iGalleryListArr.count == 1) {
        [self pushToDev:infoArr];
    } else {
        IGPushiGalleryListVC *listVC = [[IGPushiGalleryListVC alloc] initWithType:IGPushiGalleryTypeNN];
        listVC.recommendArr = infoArr;
        listVC.successBlock = ^(NSString *strValue) {
            pushSuccess=strValue;
        };
        [UIViewController ig_pushViewController:listVC animated:YES];
    }
}
#pragma mark-推送请求
- (void)pushToDev:(NSArray *)infoArr
{
    NSMutableArray *aIds = [NSMutableArray array];
    for (IGArtWorkModel *info in infoArr) {
        [aIds addObject:info.aId];
    }
    IGiGalleryEqu *equ = self.iGalleryListArr[0];
    IGiGalleryPushApi *pushApi = [[IGiGalleryPushApi alloc] initWithMacIds:@[equ.macId] pIds:aIds];
    [self presentMessageTips:NSLocalizedString(@"Pushing...", nil)];
    [pushApi startWithDecodeClass:[IGiGalleryPushResp class] CompletionBlockWithSuccess:^(id responseObject, NSError *error) {
        if (responseObject) {
            [self presentMessageTips:NSLocalizedString(@"Pushed Successfully...\n Would show up until device online.", nil)];
        }
    }];
}
#pragma mark-删除请求
-(void)deletViewClick{
    NSMutableArray *selIndexArr = [NSMutableArray array];
    for (int i=0; i<selArr.count; i++) {
        NSNumber *s = selArr[i];
        if ([s boolValue]) {
            [selIndexArr addObject:@(i)];
        }
    }
    if (selIndexArr.count==0) {
        [self presentMessageTips:NSLocalizedString(@"Select at least one Work", nil)];
        return;
    }
    NSMutableArray *infoArr = [NSMutableArray array];
    for (NSNumber *index in selIndexArr) {
     IGArtWorkModel  *info = _dataArr[[index integerValue]];
        [infoArr addObject:info.aId];
    }
    [UIAlertView bk_showAlertViewWithTitle:NSLocalizedString(@"Notice", nil) message:NSLocalizedString(@"Confirm to delete this picture/these pictures?",nil) cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:@[NSLocalizedString(@"Confirm", nil)] handler:^(UIAlertView *alertView, NSInteger buttonIndex) {
        if (buttonIndex == 1) {
            self.delApi=[[IGDelProductInDrawApi alloc]initWithDrawlistId:self.drawId pIds:infoArr];
            [self.delApi startWithDecodeClass:[IGDelProductInDrawResp class] CompletionBlockWithSuccess:^(id responseObject, NSError *error) {
                if (responseObject) {
                    
                    [self requestDate];
                }
            }];
        }
    }];
}
#pragma mark-请求绑定设备列表
-(void)requestIGlist {
    self.igalleryListApi = [[IGiGalleryListApi alloc] initWithType:IGiGalleryListTypeSuccess];
    __weak typeof(self) weakSelf = self;
    [self.igalleryListApi startWithDecodeClass:[IGiGalleryListResp class] CompletionBlockWithSuccess:^(id responseObject, NSError *error) {
        if (responseObject) {
            IGiGalleryListResp *resp = responseObject;
            IGiGalleryListModel *model = resp.data;
            weakSelf.iGalleryListArr = [NSArray arrayWithArray:model.equs];
        }
    }];
}
#pragma mark-取消操作
-(void)cancle{
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mart--设置底部菜单
-(void)setBottomBar1{
    //添加到画单
    UIView *addView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, KSCREENWIDTH/2, self.view.height)];
    addView.backgroundColor=[UIColor clearColor];
    [bottomBar addSubview:addView];
    UIButton *addBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    addBtn.contentEdgeInsets=UIEdgeInsetsMake(0, 0, -10, 0);
    addBtn.size=CGSizeMake(44, 38);
    addBtn.userInteractionEnabled=NO;
    [addBtn setImage:[UIImage imageNamed:@"画作选组-添加"] forState:UIControlStateNormal];
    addBtn.x=(addView.width-addBtn.width)/2;
    addBtn.y=0;
    [addView addSubview:addBtn];
    UILabel *addLabel=[[UILabel alloc]initWithFrame:CGRectZero];
    addLabel.text=@"添加到画单";
    addLabel.font=[UIFont font14];
    addLabel.textColor=[UIColor c3Color];
    [addLabel sizeToFit];
    addLabel.centerX=addBtn.centerX;
    addLabel.top=addBtn.bottom;
    [addView addSubview:addLabel];
    UITapGestureRecognizer *addGesturRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(addViewClick)];
    [addView addGestureRecognizer:addGesturRecognizer];
    //推送到画屏
    UIView *pushView=[[UIView alloc]initWithFrame:CGRectMake(KSCREENWIDTH/2, 0, KSCREENWIDTH/2, self.view.height)];
    pushView.backgroundColor=[UIColor clearColor];
    pushView.backgroundColor=[UIColor clearColor];
    [bottomBar addSubview:pushView];
    UIButton *pushBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    pushBtn.contentEdgeInsets=UIEdgeInsetsMake(0, 0, -10, 0);
    pushBtn.size=CGSizeMake(44, 38);
    pushBtn.userInteractionEnabled=NO;
    [pushBtn setImage:[UIImage imageNamed:@"画单详情推送-白"] forState:UIControlStateNormal];
    pushBtn.x=(pushView.width-pushBtn.width)/2;
    pushBtn.y=0;
    [pushView addSubview:pushBtn];
    UILabel *pushLabel=[[UILabel alloc]initWithFrame:CGRectZero];
    pushLabel.text=@"推送到画屏";
    pushLabel.font=[UIFont font14];
    pushLabel.textColor=[UIColor c3Color];
    [pushLabel sizeToFit];
    pushLabel.centerX=pushBtn.centerX;
    pushLabel.top=pushBtn.bottom;
    [pushView addSubview:pushLabel];
    UITapGestureRecognizer *pushGesturRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pushViewClick)];
    [pushView addGestureRecognizer:pushGesturRecognizer];
}

-(void)setBottomBar2{
    //添加到画单
    UIView *addView1=[[UIView alloc]initWithFrame:CGRectMake(0, 0, KSCREENWIDTH/3, self.view.height)];
    [bottomBar addSubview:addView1];;
    UIButton *addBtn1=[UIButton buttonWithType:UIButtonTypeCustom];
    addBtn1.contentEdgeInsets=UIEdgeInsetsMake(0, 0, -10, 0);
    addBtn1.userInteractionEnabled=NO;
    addBtn1.size=CGSizeMake(44, 38);
    [addBtn1 setImage:[UIImage imageNamed:@"画作选组-添加"] forState:UIControlStateNormal];
    [addView1 addSubview:addBtn1];
    addBtn1.centerX=addView1.width/2;
    addBtn1.y=0;
    
    UILabel *addLabel1=[[UILabel alloc]initWithFrame:CGRectZero];
    addLabel1.text=@"添加到画单";
    addLabel1.font=[UIFont font14];
    addLabel1.textColor=[UIColor c3Color];
    [addLabel1 sizeToFit];
    addLabel1.centerX=addBtn1.centerX;
    addLabel1.top=addBtn1.bottom;
    [addView1 addSubview:addLabel1];
    UITapGestureRecognizer *addGesturRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(addViewClick)];
    [addView1 addGestureRecognizer:addGesturRecognizer];
    //删除画单
    UIView *deletView1=[[UIView alloc]initWithFrame:CGRectMake(KSCREENWIDTH/3, 0, KSCREENWIDTH/3, self.view.height)];
    deletView1.userInteractionEnabled=YES;
    [bottomBar addSubview:deletView1];
    UIButton *deletBtn1=[UIButton buttonWithType:UIButtonTypeCustom];
    deletBtn1.contentEdgeInsets=UIEdgeInsetsMake(0, 0, -10, 0);
    deletBtn1.size=CGSizeMake(44, 38);
    deletBtn1.userInteractionEnabled=NO;
    [deletBtn1 setImage:[UIImage imageNamed:@"多选删除"] forState:UIControlStateNormal];
    [deletView1 addSubview:deletBtn1];
    deletBtn1.x=(deletView1.width-deletBtn1.width)/2;
    deletBtn1.y=0;
    
    UILabel *deletLabel1=[[UILabel alloc]initWithFrame:CGRectZero];
    deletLabel1.text=@"删除";
    deletLabel1.font=[UIFont font14];
    deletLabel1.textColor=[UIColor c3Color];
    [deletLabel1 sizeToFit];
    deletLabel1.centerX=deletBtn1.centerX;
    deletLabel1.top=deletBtn1.bottom;
    [deletView1 addSubview:deletLabel1];
    UITapGestureRecognizer *deletGesturRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(deletViewClick)];
     deletGesturRecognizer.numberOfTapsRequired=1;
    [deletView1 addGestureRecognizer:deletGesturRecognizer];
    //推送到画屏
    UIView *pushView1=[[UIView alloc]initWithFrame:CGRectMake(KSCREENWIDTH*2/3, 0, KSCREENWIDTH/3, self.view.height)];
    [bottomBar addSubview:pushView1];
    UIButton *pushBtn1=[UIButton buttonWithType:UIButtonTypeCustom];
    pushBtn1.userInteractionEnabled=NO;
    pushBtn1.contentEdgeInsets=UIEdgeInsetsMake(0, 0, -10, 0);
    pushBtn1.size=CGSizeMake(44, 38);
    [pushBtn1 setImage:[UIImage imageNamed:@"画单详情推送-白"] forState:UIControlStateNormal];
    [pushView1 addSubview:pushBtn1];
    pushBtn1.x=(pushView1.width-pushBtn1.width)/2;
    pushBtn1.y=0;
    
    UILabel *pushLabel1=[[UILabel alloc]initWithFrame:CGRectZero];
    pushLabel1.text=@"推送到画屏";
    pushLabel1.font=[UIFont font14];
    pushLabel1.textColor=[UIColor c3Color];
    [pushLabel1 sizeToFit];
    pushLabel1.centerX=pushBtn1.centerX;
    pushLabel1.top=pushBtn1.bottom;
    [pushView1 addSubview:pushLabel1];
    UITapGestureRecognizer *pushGesturRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pushViewClick)];
    pushGesturRecognizer.numberOfTapsRequired=1;
    [pushView1 addGestureRecognizer:pushGesturRecognizer];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
